import request from '@/utils/request'

// 创建仓库单据
export function createOrder(data) {
  return request({
    url: '/warehouse/order/create',
    method: 'post',
    data: data
  })
}

// 更新仓库单据
export function updateOrder(data) {
  return request({
    url: '/warehouse/order/update',
    method: 'put',
    data: data
  })
}

// 删除仓库单据
export function deleteOrder(id) {
  return request({
    url: '/warehouse/order/delete?id=' + id,
    method: 'delete'
  })
}


// 根据批次号获得工艺路线
export function getProcessRouteByBatch(batchNo) {
  return request({
    url: '/report/bad-quality-traceability/getProcessRouteByBatch?batchNo=' + batchNo,
    method: 'get'
  })
}


// 根据批次号和工序获得投料记录
export function getFeedingByBatch(param) {
  return request({
    url: '/report/bad-quality-traceability/getFeedingByBatch?batchNo=' + param.batchNo + '&procedureId=' + param.procedureId,
    method: 'get'
  })
}

// 根据批次号和工序获得质检录
export function getQualityTaskByBatch(param) {
  return request({
    url: '/report/bad-quality-traceability/getQualityTaskByBatch?batchNo=' + param.batchNo + '&procedureId=' + param.procedureId,
    method: 'get'
  })
}


// 根据批次号和工序获得报工记录
export function getReportByBatch(param) {
  return request({
    url: '/report/bad-quality-traceability/getReportByBatch?batchNo=' + param.batchNo + '&procedureId=' + param.procedureId,
    method: 'get'
  })
}


// 根据批次号和工序获得线边库存
export function getStorageMaterialByBatch(param) {
  return request({
    url: '/report/bad-quality-traceability/getStorageMaterialByBatch?batchNo=' + param.batchNo + '&procedureId=' + param.procedureId,
    method: 'get'
  })
}






